Homebrew on Linux
Linux上にHomebrewを導入した際の記録。基本的にはほぼ公式ページに従っている。導入の直接的な動機としては、Terraformのversion managerであるtfenvや、gcloud、awsといったコマンドをWSL2上で実行できるようにしたかったから。
Install
code:step1
:
==> Next steps:
- Run brew help to get started
- Further documentation:
- Install the Homebrew dependencies if you have sudo access:
Debian, Ubuntu, etc.
sudo apt-get install build-essential
Fedora, Red Hat, CentOS, etc.
sudo yum groupinstall 'Development Tools'
- Configure Homebrew in your /home/perforb/.profile by running
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> /home/perforb/.profile
- Add Homebrew to your PATH
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
- We recommend that you install GCC by running:
brew install gcc
code:step2
$ sudo apt update && sudo apt upgrade
$ sudo apt install build-essential curl file git
code:step3
$ test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
$ test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
$ test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
$ echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
code:step4
$ brew install gcc
cf.